@extends('layouts.master3')
@section("title")
    千里码-讨论区
@endsection
@section("css")
    <link href="/css/base.css" rel="stylesheet">
    <link href="/css/discuss.css" rel="stylesheet">
@endsection
@section("content")
    <?php
    use App\Utils;
    ?>
    <div class="contain">

        <div class="qa-body-wrapper">
            <!--<div class="qa-header">-->
            <!--<div class="qa-header-clear">-->
            <!--</div>-->
            <!--<form class="qa-search-bar" method="get" action="" _lpchecked="1">-->
            <!--<div class="input-group">-->
            <!--<input type="text" name="q" value="" class="form-control" placeholder=" Search">-->
            <!--<span class="input-group-btn">-->
            <!--<button type="submit" class="btn btn-primary">-->
            <!--&nbsp;<span class="glyphicon glyphicon-search">-->
            <!--</span>&nbsp;</button>-->
            <!--</span>-->
            <!--</div>-->
            <!--</form>-->
            <!--<a href="./ask" class="btn btn-success btn-lg qa-ask-btn">提问</a>-->
            <!--</div>-->
            <!-- ql-header E-->
            <div class="qa-main-shadow">
                <div class="qa-main-wrapper">
                    <div class="fl">
                        @if($tag!="all" && $tag != 'topic')
                            <div class="qa-module">
                                <div class="qa-module-title"><a target="_blank"
                                                                href="/task/{{Utils::id2url($task->id)}}">{{$tag}}</a>
                                </div>
                                <div class="qa-module-detail clear">
									<p><?php echo $task->material;?></p>
                                    <span class="fr"> ——{{$task->user->name}}</span>
                                </div>
                            </div>
                            @endif
                                    <!-- qa-module E -->
                            <div class="qa-nav-main">
                                <ul class="qa-nav-main-list">
                                    <li class="qa-nav-main-item qa-nav-main-new">
                                        <a href="/discuss/{{$tag}}/new"
                                           class="qa-nav-main-link <?php if ($type == "new") echo 'active';?>">最新</a>
                                    </li>
                                    <li class="qa-nav-main-item qa-nav-main-hot">
                                        <a href="/discuss/{{$tag}}/hot"
                                           class="qa-nav-main-link <?php if ($type == "hot") echo 'active';?>">热门</a>
                                    </li>
                                    <li class="qa-nav-main-item qa-nav-main-unanswered">
                                        <a href="/discuss
/{{$tag}}/unanswered" class="qa-nav-main-link <?php if ($type == "unanswered") echo 'active';?>">未回答</a>
                                    </li>
                                </ul>

                                <div class="qa-nav-main-clear">
                                </div>

                            </div>

                            <div class="qa-main">
                                <!--<h1>最新问题与解答</h1>-->
                                <div class="qa-part-q-list">
                                    <div class="qa-q-list qa-q-list-vote-disabled">
                                        @if(count($questions)==0) 暂无未回答的问题 @endif
                                        @foreach($questions as $q)
                                            <div class="qa-q-list-item" id="1">
                                                <div class="qa-q-item-stats">
                                                    <!--<div class="qa-voting qa-voting-net" id="voting_91606">-->
                                                    <!--<div class="qa-vote-count qa-vote-count-net">-->
                                                    <!--<span class="qa-netvote-count">-->
                                                    <!--<span class="qa-netvote-count-data">0</span><span class="qa-netvote-count-pad"> votes</span>-->
                                                    <!--</span>-->
                                                    <!--</div>-->
                                                    <!--<div class="qa-vote-clear"></div>-->
                                                    <!--</div>-->
                                    <span class="qa-a-count qa-a-count-zero">
                                        <span class="qa-a-count-data">{{$q->ansnum}}</span><span class="qa-a-count-pad"> 回答</span>
                                    </span>
                                    <span class="qa-view-count">
                                        <span class="qa-view-count-data">{{$q->vote}}</span><span
                                                class="qa-view-count-pad"> 浏览</span>
                                    </span>

                                                </div>
                                                <div class="qa-q-item-main">
                                                    <div class="qa-q-item-title">
                                                        @if($q->firstc==null)
                                                            <a target="_blank" href="/q/{{Utils::id2url($q->id)}}"><span
                                                                        title="">{{$q->title}}</span></a>

                                                        @else
                                                            <a target="_blank"
                                                               href="/q/{{Utils::id2url($q->id)}}#{{Utils::id2url($q->firstc->id)}}"><span
                                                                        title="">{{$q->title}}</span></a>
                                                        @endif

                                                    </div>
                                    <span class="qa-q-item-avatar-meta">
                                        <span class="qa-q-item-meta">
                                            @if ($q->firstc==null || $q->tag == 'topic')
                                                <a target="_blank" href="/profile/{{Utils::id2url($q->user->id)}}"
                                                   class="qa-user-link gray">{{$q->user->name}}</a>
                                                <span class="qa-q-item-when"> {{$q->created_at}}提问</span>
                                            @else
                                                <a target="_blank"
                                                   href="/profile/{{Utils::id2url($q->firstc->user->id)}}"
                                                   class="qa-user-link gray">{{$q->firstc->user->name}}</a>
                                                <span class="qa-q-item-when"> {{$q->firstc->created_at}}回答</span>

                                            @endif
                                            @if($q->tag!="其他")
                                                <a class="qa-q-item-class gray" href="/discuss/{{$q->tag}}"
                                                   target="_blank">{{$q->tag}}</a>
                                            @endif
                                        </span>
                                    </span>

                                                </div>
                                                <div class="qa-q-item-clear">
                                                </div>
                                            </div> <!-- END qa-q-list-item -->
                                        @endforeach

                                    </div> <!-- END qa-q-list -->
                                </div>
                                <?php echo $questions->render();?>
                            </div>
                    </div>
                    <div class="fr">
                        @if($tag!='topic')
                        <a href="/ask
@if($tag!="all")/{{$tag}} @endif" target="_blank" class="btn btn-success pull-right ask-q">发起讨论</a>
                        @endif
                        <div class="clear"></div>
                        <!-- nav-main E-->
                        <div class="qa-sidepanel">
                            <div class="qa-sidebar well">
                                @if($tag === 'topic')
                                    @include('dis.topic_bulletin')
                                @else
                                    @include('dis.bulletin')
                                @endif
                            </div>
                        </div>
                        <!-- qa-sidebar E-->
                    </div>

                </div>
            </div>
        </div>

    </div>
@endsection

